fix: remove stage dependent mandatory fields for plans datasets - #576
Conversation
WalkthroughUpdated mandatory-field definitions for four plan datasets and added a unit test confirming that selected blank local-plan fields are not reported as missing during harmonisation. ChangesPlan mandatory fields
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/phase/test_harmonise.py (1)
160-207: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the other three plan datasets as well.
This regression test only exercises
local-plan, while the mandatory-field contract was changed for all four plan datasets. Parameterise the test, or add equivalent cases for supplementary, minerals, and waste plans, so an incorrect field removal in those datasets cannot pass unnoticed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/phase/test_harmonise.py` around lines 160 - 207, Extend test_harmonise_stage_dependent_plan_fields_not_flagged to cover supplementary, minerals, and waste plan datasets in addition to local-plan, using parameterisation or equivalent cases. Ensure each dataset verifies that period-end-date, document-url, and required-housing remain unflagged when blank.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/phase/test_harmonise.py`:
- Around line 160-207: Extend
test_harmonise_stage_dependent_plan_fields_not_flagged to cover supplementary,
minerals, and waste plan datasets in addition to local-plan, using
parameterisation or equivalent cases. Ensure each dataset verifies that
period-end-date, document-url, and required-housing remain unflagged when blank.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1c170d60-8135-4927-a937-03d67a7b1142
📒 Files selected for processing (2)
digital_land/phase/harmonise.pytests/unit/phase/test_harmonise.py
💤 Files with no reviewable changes (1)
- digital_land/phase/harmonise.py
What type of PR is this? (check all applicable)
Description
Remove
period-end-dateanddocument-url(all four plan datasets) andrequired-housing(local-plan only) from MANDATORY_FIELDS_DICT inharmonise.py, so blanks no longer raisemissing valueissues.Why
These fields are stage-dependent: an LPA only holds this data once it has reached
proposed-plan-consultation-startin its plan-timetable. The current binary check fires for every LPA that hasn't reached that stage, producing false-positive tasks on the LPA Dashboard (and in the check tool).This is just phase 1
This PR only removes the false positives. Restoring the correct signal — flag only once
proposed-plan-consultation-starthas anactual-datein the past — we be a separeate PR (probably 3 PRs across different repos) as a post-build expectation Still as part of this ticket. My plan is to have no check on these fields for a period of time probably a few days. But we can delay this PR until phase 2 is ready if we think have false positives is better than having no positives?Added a regression test asserting these fields are not flagged when blank.
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note
on the devices and browsers this has been tested on, as well as any relevant
images for UI changes.
Added/updated tests?
We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.
have not been included
[optional] Are there any post deployment tasks we need to perform?
[optional] Are there any dependencies on other PRs or Work?
Summary by CodeRabbit